package com.aabte.design2.behavioral.state;

/**
 * @author Daniel
 * @version 1.0
 * @date 2020/5/4
 */
public class PlayingState extends State {
    public PlayingState(AudioPlayer player) {
        super(player);
    }

    @Override
    void clickLock() {
        player.stopPlayback();
        player.changeState(new LockedState(player));
    }

    @Override
    void clickPlay() {
        player.stopPlayback();
        player.changeState(new ReadyState(player));
    }

    @Override
    void clickNext() {
        player.nextSong();
    }

    @Override
    void clickPrevious() {
        player.previousSong();
    }
}
